<?php
/** @var TPersonaController $this */
/** @var TPersona $model */
/** @var AweActiveForm $form */
$form = $this->beginWidget('ext.AweCrud.components.AweActiveForm', array(
    'type' => 'horizontal',
    'id' => 'tpersona-form',
    'enableAjaxValidation' => false,
    'clientOptions' => array('validateOnSubmit' => true, 'validateOnChange' => false,),
    'enableClientValidation' => true,
        ));
Util::tsRegisterAssetJs('_form.js');
?>
<div class="widget blue">
    <div class="widget-title">
        <h4><i class="icon-plus"></i><?php echo Yii::t('AweCrud.app', $model->isNewRecord ? 'Create' : 'Update') . ' ' . TPersona::label(1); ?></h4>
        <span class="tools">
            <a href="javascript:;" class="icon-chevron-down"></a>
            <!--a href="javascript:;" class="icon-remove"></a-->
        </span>
    </div>
    <div class="widget-body">



        <?php echo $form->textFieldRow($model, 'per_cedula', array('maxlength' => 20)) ?>

        <?php echo $form->textFieldRow($model, 'per_nombre', array('maxlength' => 60)) ?>

        <?php echo $form->textFieldRow($model, 'per_apellido', array('maxlength' => 50)) ?>

        <?php
        echo $form->datepickerRow($model, 'per_fechanacimiento', array(
//        'class' => 'span12',
            'class' => 'span8 hasDatepicker',
            'readOnly' => 'true',
            'options' => array(
                'format' => 'dd/mm/yyyy',
                'startView' => 2,
                'language' => 'es',
                'endDate' => 'thisYear',
                'language' => 'es',
                'keyboardNavigation' => true,
                'autoclose' => 'true',
                'forceParse' => false,
            ),
        ));
        ?>

        <?php echo $form->textFieldRow($model, 'per_lugar_nacimiento', array('maxlength' => 40)) ?>

        <?php echo $form->textFieldRow($model, 'per_direccionresi', array('maxlength' => 100)) ?>

        <?php echo $form->textFieldRow($model, 'per_numcasa', array('maxlength' => 20)) ?>

        <?php echo $form->textFieldRow($model, 'per_referencia', array('maxlength' => 60)) ?>

        <?php echo $form->textFieldRow($model, 'per_telf', array('maxlength' => 15)) ?>

        <?php echo $form->textFieldRow($model, 'per_cel', array('maxlength' => 15)) ?>

        <?php echo $form->textFieldRow($model, 'per_mail', array('maxlength' => 60)) ?>

        <?php echo $form->textFieldRow($model, 'per_genero', array('maxlength' => 11)) ?>

        <?php // echo $form->textFieldRow($model, 'per_foto', array('maxlength' => 400))
        ?>

        <div id="content_prev" class="row" hidden>
            <div class="span-10">
                <div class="thumbnail">
                    <img id="img_prev" data-src="holder.js/50%x100" alt="50%x150" src="#">

                    <div class="caption">
                        <h4><strong>Imagen</strong></h4>

                        <p>
                            <a id="btn_upload_change" href="#" class="btn btn-info" role="button">
                                <i class="fa fa-arrows-h"></i>
                                Cambiar</a>
                        </p>
                    </div>
                </div>
            </div>
        </div>
        <div id="content_action" class="row">

            <form id="logo-form" class="form-horizontal" role="form">
                <div class="form-group form-group-sm">
                    <label for="formGroupInputSmall">Imagen</label>
                    <div class="span9">
                        <button id="btn_upload_action" class="btn btn-default btn-xs"><i
                                class="fa fa-plus"></i> Seleccione
                        </button>
                        <input name="logo_imagen" id="logo_imagen" type="file" style="display: none">
                    </div>
                </div>

            </form>

        </div>
        <?php echo $form->hiddenField($model, 'per_foto') ?>
        <?php echo $form->textFieldRow($model, 'per_tiposangre', array('maxlength' => 6)) ?>

        <?php echo $form->textFieldRow($model, 'per_estadocivil', array('maxlength' => 20)) ?>
    </div>                <div class="form-actions">
        <?php
        $this->widget('bootstrap.widgets.TbButton', array(
            'buttonType' => 'submit',
            'type' => 'success',
            'label' => $model->isNewRecord ? Yii::t('AweCrud.app', 'Create') : Yii::t('AweCrud.app', 'Save'),
        ));
        ?>
        <?php
        $this->widget('bootstrap.widgets.TbButton', array(
            'label' => Yii::t('AweCrud.app', 'Cancel'),
            'htmlOptions' => array('onclick' => 'javascript:history.go(-1)')
        ));
        ?>
    </div>
</div>
</div>
<?php $this->endWidget(); ?>
